﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Topics.aspx.cs" Inherits="Topics_Topics" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" language="javascript" type="text/javascript"></script>
    <script>
        $(document).ready(function () {
            $("[isc=true]").each(function (i) {
                var value = $(this).attr("IsEnable");
                if (value == "True") {
                    $(this).val("true");
                }
                else {
                    $(this).val("false");
                }
            })
            $("[isc=true]").change(function () {
                var topicId = $(this).attr("topicId");
                var value = $(this).val();
                $.post("handler/topicfb.ashx", { topicId: topicId, IsEnable: value }, function (data) {
                    if (data != 1) {
                        alert("更新失败");
                    }
                })
            })

        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="button_bar">
        <asp:Button ID="btnAdd" CssClass="common_button" runat="server" Text="添加" 
            onclick="btnAdd_Click"   />
        <input type="button" class="common_button" value="投票管理" onclick="document.location='Statistics.aspx'" style=" width:100px" />
        <input type="button" class="common_button" value="专题首页图片" onclick="document.location='TopImages.aspx'" style=" width:100px" />
    </div>
    <div>
        <table class="data_list_table">
            <tr>
                <th>标题</th>
                <th>概要</th>
                <th>创建时间</th>
                <th>修改时间</th>
                <th>是否发布</th>
                <th>操作</th>
            </tr>
            <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                    <tr>
                        <td class="list_data_text"><%# Eval("Title")%></td>
                        <td class="list_data_text"><%# Eval("Summary")%></td>
                        <td class="list_data_text"><%# Eval("CTime")%></td>
                        <td class="list_data_text"><%# Eval("UTime")%></td>
                        <td><select isc="true" topicId='<%# Eval("id") %>' IsEnable='<%# Eval("IsEnable") %>' ><option value="false">否</option><option value="true">是</option> </select> </td>
                        <td class="list_data_text"><a href='Topics_step1.aspx?tid=<%# Eval("id") %>&flag=edit '>
                                修改</a>  
                                <a href='news.aspx?tid=<%# Eval("id") %>'>相关新闻</a>
                                <a href="Topics_Charts.aspx?tid=<%# Eval("id") %>">相关图表</a>
                                <a href="http://stock.emoney.cn/topic/topic_d.aspx?id=<%# Eval("id") %>" target="_blank">预览</a>
                                <a href='Topics_del.aspx?tid=<%# Eval("id") %>'
                                    onclick="return confirm('确定删除？')">
                                    <img src="../images/bt_del.gif" alt="删除" />
                                </a></td>
                    </tr>        
                </ItemTemplate>
            </asp:Repeater>
            
        </table>
    </div>
    </form>
</body>
</html>
